const express = require('express');
const path = require('path');
const qianTai = express.Router();
const muBanYinQing = require(path.resolve('moKuai/muBanYinQing.js'));

//首页路由
qianTai.get('/', async function(qingQiu, xiangYing) {
	let yeMian = await muBanYinQing('shouYe');
	xiangYing.send(yeMian);
})
qianTai.get('/index.html', async function(qingQiu, xiangYing) {
	let yeMian = await muBanYinQing('shouYe');
	xiangYing.send(yeMian);
})
//栏目路由
qianTai.get('/lanMu-:lHao', async function(qingQiu, xiangYing) {
	let yeMian = await muBanYinQing('lanMu', qingQiu.params.lHao);
	xiangYing.send(yeMian);
})
//文章路由
qianTai.get('/wenZhang-:wHao', async function(qingQiu, xiangYing) {
	let yeMian = await muBanYinQing('wenZhang', qingQiu.params.wHao);
	xiangYing.send(yeMian);
})

module.exports = qianTai;